package com.example.mes.service.Imple;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mes.mapper.MaterialInfoMapper;
import com.example.mes.model.MaterialInfo;
import com.example.mes.model.PageResult;
import com.example.mes.service.interfase.IMaterialInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

@Service
public class MaterialInfoImpl extends ServiceImpl<MaterialInfoMapper,MaterialInfo> implements IMaterialInfo {
    @Autowired(required = false)
    MaterialInfoMapper materialInfoMapper;
//    RedisTemplate redisTemplate;
    public PageResult<MaterialInfo> findList() {
        PageResult<MaterialInfo>result=new PageResult<MaterialInfo>();
//        ValueOperations operations = redisTemplate.opsForValue();
//        List<MaterialInfo> list = (List)operations.get("materialInfo");
        Page<MaterialInfo> page =  materialInfoMapper.selectPage(new Page<>(1,6),null);
//        result.setData(list);
        result.setData(page.getRecords());
        return result;
    }


}
